<?php
/**
 * Created by PhpStorm.
 * Author: 芸签cms www.yunqiancms.com
 * User: sun
 * Date: 2022/7/12
 * Time: 2:12 PM
 */
namespace app\backend\modules\theme\controllers;

use app\backend\controllers\BaseController;
use app\backend\modules\theme\services\MarketService;


class MarketController extends BaseController
{
    public function index(){
        return view("backend.theme.market.index");
    }

    public function getList(){
        $search = request()->search;
        $list = (new MarketService())->getList($search);
        return $this->successJson('',$list);
    }
    public function local(){
        return view("backend.theme.market.local");
    }
    public function getLocalList(){
        $search = request()->search;
        $list = (new MarketService())->getLocalList($search);
        return $this->successJson('',$list);
    }
    public function detail(){
        return view("backend.theme.market.detail");
    }
    public function getDetail(){
        $id = intval(request()->id);
        $domain = request()->getHttpHost();
        $result = (new MarketService())->getDetail($id, $domain);

        return $this->successJson('',$result);
    }
}